﻿using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;

namespace Furesoft.Styling.Functions
{
    public class RegionFunctions
    {
        public static Region ellipse(Number x, Number y, Number width, Number height)
        {
            GraphicsPath reg = new GraphicsPath();
            reg.AddEllipse(x.ToInt(), y.ToInt(), width.ToInt(), height.ToInt());

            return new Region(reg);
        }
        public static Region pie(Number x, Number y, Number width, Number height, Number startAngle, Number sweepAngle)
        {
            GraphicsPath reg = new GraphicsPath();
            reg.AddPie(x.ToInt(), y.ToInt(), width.ToInt(), height.ToInt(), startAngle.ToFloat(), sweepAngle.ToFloat());

            return new Region(reg);
        }
        public static Region triangle()
        {
            GraphicsPath reg = new GraphicsPath();
            reg.AddLines(new Point[] { new Point(0, 0), new Point(50, 0), new Point(50, 50) });

            return new Region(reg);
        }
    }
}
